ValidationStrategy<T>
Assembly: ServiceStack.dll
View Source
public class ValidationStrategy<T>
Methods
IncludeProperties(String[])
Indicates that only the specified properties should be validated.
View Source
public ValidationStrategy<T> IncludeProperties(params string[] properties)
Returns
ServiceStack.FluentValidation.Internal.ValidationStrategy<T>
Parameters
Type | Name | Description |
---|---|---|
System.String[] | properties | The property names to validate. |
|
IncludeProperties(Expression<Func<T, Object>>[])
Indicates that only the specified properties should be validated.
View Source
public ValidationStrategy<T> IncludeProperties(params Expression<Func<T, object>>[] propertyExpressions)
Returns
ServiceStack.FluentValidation.Internal.ValidationStrategy<T>
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<<T>,System.Object>>[] | propertyExpressions | The properties to validate, defined as expressions. |
|
IncludeRulesNotInRuleSet()
Indicates that all rules not in a rule-set should be included for validation (the equivalent of calling IncludeRuleSets("default")). This method can be combined with IncludeRuleSets.
View Source
public ValidationStrategy<T> IncludeRulesNotInRuleSet()
Returns
ServiceStack.FluentValidation.Internal.ValidationStrategy<T>
IncludeAllRuleSets()
Indicates that all rules should be executed, regardless of whether or not they're in a ruleset. This is the equivalent of IncludeRuleSets("*").
View Source
public ValidationStrategy<T> IncludeAllRuleSets()
Returns
ServiceStack.FluentValidation.Internal.ValidationStrategy<T>
IncludeRuleSets(String[])
Indicates that only the specified rule sets should be validated.
View Source
public ValidationStrategy<T> IncludeRuleSets(params string[] ruleSets)
Returns
ServiceStack.FluentValidation.Internal.ValidationStrategy<T>
Parameters
Type | Name | Description |
---|---|---|
System.String[] | ruleSets | The names of the rulesets to validate. |
|
UseCustomSelector(IValidatorSelector)
Indicates that the specified selector should be used to control which rules are executed.
View Source
public ValidationStrategy<T> UseCustomSelector(IValidatorSelector selector)
Returns
ServiceStack.FluentValidation.Internal.ValidationStrategy<T>
Parameters
Type | Name | Description |
---|---|---|
ServiceStack.FluentValidation.Internal.IValidatorSelector | selector | The custom selector to use |
|
ThrowOnFailures()
Indicates that the validator should throw an exception if it fails, rather than return a validation result.
View Source
public ValidationStrategy<T> ThrowOnFailures()
Returns
ServiceStack.FluentValidation.Internal.ValidationStrategy<T>